"use strict";

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
  const { router, controller } = app;
  router.get("/bx", controller.bx.index);
  router.get("/ceshi", controller.ceshi.index);
  //登录
  router.get("/user", controller.user.index);
  router.get("/getUser/:id", controller.user.show);
  router.put("/putUser/:id", controller.user.update);
  router.post("/addUser", controller.user.create);
  // 首页
  router.get("/msjhomes", controller.msjhomes.index); // 获取首页详情
  router.get("/msjhomes/:id", controller.msjhomes.show);

  //彩市场
  router.get("/weicsc", controller.weicsc.index); //市场详情 // router.get('/weishingc', controller.weishingc.index) //评论
  router.put("/putweicsc/:id", controller.weicsc.update); //市场详情 
  router.delete("/delweicsc/:id", controller.weicsc.destroy); //市场详情 

  router.put("/addweishingc/:id", controller.weicsc.update); //商品发布
  router.get("/weifanbu", controller.weifanbu.index);
  router.post("/addweicsc", controller.weicsc.create); //发布

  // 彩活动
  router.get("/bx", controller.bx.index);
  router.get("/bx/:id", controller.bx.show);
  router.put("/bx/updatebx/:id", controller.bx.update);
  router.post("/bx/add", controller.bx.create);
  router.delete("/bx/del/:id", controller.bx.destroy);

  //订单
  router.get("/zwydingdan", controller.zwydingdan.index);
  router.post("/zwydingdanAdd", controller.zwydingdan.create);
  router.put("/puzwydingdan/:id", controller.zwydingdan.update);

  // 图片上传
  router.post("/upload", controller.lmhUpload.updatepuSubPic);
  // router.delete('/api/orderzzm/:id', controller.orderzzm.destroy);//删除
  // LG
  // 获取 controller.user1.index   user1要改成后台数据库的名字
  // router.get('/api/findschool', controller.school.index);//查找
  // router.get('/api/school/:id', controller.school.show);//查找
  // router.post('/api/addschool', controller.school.create)//增加b b
  // router.delete('/api/delschool/:id', controller.school.destroy);//删除
  // router.put('/api/xgschool/:id', controller.school.update); // 更新
};
